import 'package:ichinesereader/exam/dto/assessment.response.dart';

class QuestionDetails {
  QuestionDetails({
    this.question,
    this.id,
    this.content,
  });

  List<QuestionItem>? question;
  String? id;
  QuestionContent? content;

  factory QuestionDetails.fromJson(Map<String, dynamic> json) =>
      QuestionDetails(
        question: List<QuestionItem>.from(
            json["question"].map((x) => QuestionItem.fromJson(x))),
        id: json["id"],
        content: QuestionContent.fromJson(json["content"]),
      );

  Map<String, dynamic> toJson() => {
        "question": question != null
            ? List<dynamic>.from(question!.map((x) => x.toJson()))
            : null,
        "id": id,
        "content": content != null ? content?.toJson() : null,
      };
}
